/*
 * @(#)UserRepositoryTest.java $version 2012. 4. 4.
 *
 * Copyright 2012 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

package com.mywep.myalimi.repository.user;

import static org.junit.Assert.*;

import java.util.List;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.mywep.myalimi.model.User;

import com.nhncorp.lucy.spring.core.util.DataMap;

/**
 * @author 한지웅
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:applicationContext.xml")
public class UserRepositoryTest {
	@Autowired
	private UserRepository userRepository;

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
	}

	/**
	 * Test method for {@link com.mywep.myalimi.repository.user.UserRepository#countByExample(com.nhncorp.lucy.spring.core.util.ExtendedMap)}.
	 */
	@Test
	public void testCountByExample() {
		DataMap param = new DataMap();
		int result = userRepository.countByExample(param);
		assertTrue(result >= 1);
	}

	/**
	 * Test method for {@link com.mywep.myalimi.repository.user.UserRepository#selectByExample(com.nhncorp.lucy.spring.core.util.ExtendedMap)}.
	 */
	@Test
	public void testSelectByExample() {
		DataMap param = new DataMap();
		List<User> userList = userRepository.selectByExample(param);
		assertTrue(userList.size() >= 1);
	}

	/**
	 * Test method for {@link com.mywep.myalimi.repository.user.UserRepository#selectByPrimaryKey(com.mywep.myalimi.model.User)}.
	 */
	@Test
	public void testSelectByPrimaryKey() {
		User param = new User();
		param.setId("banhju");
		User user = userRepository.selectByPrimaryKey(param);
	}

}
